package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.CsOrgFallBack;
import cn.cs.fallback.CsRoleFallBack;
import cn.cs.pojo.CsMenuRole;
import cn.cs.pojo.CsOrg;
import cn.cs.pojo.CsRole;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * Created by yuexl
 */
@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsRoleFallBack.class)
public interface CsRoleClient {


    @RequestMapping(value = "/getCsRoleById", method = RequestMethod.POST)
    public CsRole getCsRoleById(@RequestParam("id") Long id) throws Exception;

    @RequestMapping(value = "/getCsRoleListByMap", method = RequestMethod.POST)
    public List<CsRole> getCsRoleListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCsRoleCountByMap", method = RequestMethod.POST)
    public Integer getCsRoleCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addCsRole", method = RequestMethod.POST)
    public Integer addCsRole(@RequestBody CsRole csRole) throws Exception;

    @RequestMapping(value = "/modifyCsRole", method = RequestMethod.POST)
    public Integer modifyCsRole(@RequestBody CsRole csRole) throws Exception;

    @RequestMapping(value = "/deleteCsRoleById", method = RequestMethod.POST)
    public Integer deleteCsRoleById(@RequestParam("id") String id) throws Exception;

    @RequestMapping(value = "/insertRoleMenusBatch", method = RequestMethod.POST)
    public Integer insertRoleMenusBatch(@RequestBody List<CsMenuRole> list, @RequestParam("role_id") String role_id);
}

